Skip to content

Comments

Fixed the 18751 and 18896 flaky tests#33737

Merged
PureWeen merged 5 commits intodotnet:mainfrom
Ahamed-Ali:ImageTestFailure
Feb 2, 2026
Merged

Fixed the 18751 and 18896 flaky tests#33737
PureWeen merged 5 commits intodotnet:mainfrom
Ahamed-Ali:ImageTestFailure

Conversation

@Ahamed-Ali
Copy link
Contributor

@Ahamed-Ali Ahamed-Ali commented Jan 28, 2026

Description of Change

This pull request updates test data and test code for two monkey-related UI test cases, focusing on removing dependencies on external internet resources and cleaning up test attributes and structure. The main changes include switching image sources from URLs to local files, removing internet connectivity checks, and simplifying test code and attributes.

Test Data Updates:

  • Updated all ImageUrl fields in the MonkeysViewModel (used by both issues) to reference local image files instead of external URLs, eliminating the need for internet access during tests.

Test Code Cleanup and Simplification:

  • Removed internet connectivity checks and related test delays from Issue18751Test and Issue18896Test, since images are now loaded locally. [1] [2]
  • Simplified screenshot verification in Issue18896Test by removing the retry delay parameter.

UI Test Enhancement:

  • Enabled HasUnevenRows in the ListView for Issue18896 to better support variable item heights.

Issues Fixed

Fixes #33507

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jan 28, 2026
@sheiksyedm sheiksyedm added the area-testing Unit tests, device tests label Jan 28, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review January 28, 2026 12:28
Copilot AI review requested due to automatic review settings January 28, 2026 12:28
@sheiksyedm
Copy link
Contributor

/azp run maui-pr-uitests 

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request aims to reduce flakiness in Issue18751/Issue18896 UI tests by removing reliance on external network-hosted images and simplifying the tests now that data is local.

Changes:

  • Switched monkey image sources from external URLs to local image files in HostApp test data.
  • Simplified the Issue18751/Issue18896 UI tests by removing internet connectivity checks and related attributes.
  • Updated Issue18896 UI (ListView) configuration to better support variable row heights.

Reviewed changes

Copilot reviewed 5 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18896.cs Removes connectivity checks/skip attributes; keeps a fixed sleep before screenshot (flakiness concern).
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue18751.cs Removes connectivity checks and async delay; simplifies test to screenshot after page load.
src/Controls/tests/TestCases.HostApp/Issues/Issue18896.xaml.cs Drops isInternetRequired: true from the Issue attribute.
src/Controls/tests/TestCases.HostApp/Issues/Issue18896.xaml Adds HasUnevenRows="True" and minor formatting updates.
src/Controls/tests/TestCases.HostApp/Issues/Issue18751.xaml.cs Updates MonkeysViewModel image references to local files (but Issue attribute still says internet required).
src/Controls/tests/TestCases.HostApp/Resources/Images/papio.jpg Adds local image asset used by test data.
src/Controls/tests/TestCases.HostApp/Resources/Images/capuchin.jpg Adds local image asset used by test data.
src/Controls/tests/TestCases.HostApp/Resources/Images/saimiri.jpg Adds local image asset used by test data.
src/Controls/tests/TestCases.HostApp/Resources/Images/golden.jpg Adds local image asset used by test data.
src/Controls/tests/TestCases.HostApp/Resources/Images/alouatta.jpg Adds local image asset used by test data.

@Ahamed-Ali Ahamed-Ali added the community ✨ Community Contribution label Jan 28, 2026
Copy link
Contributor

@kubaflo kubaflo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you fix the copilot suggestions it will be ready to go

@rmarinho
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

PureWeen added a commit that referenced this pull request Jan 29, 2026
- Issue18751/18896 local images: covered by #33737
- Issue12134 timeout: covered by #33689 (uses native CookieManager)
PureWeen added a commit that referenced this pull request Jan 29, 2026
- Issue18751/18896 local images: covered by #33737
- Issue12134 timeout: covered by #33689 (uses native CookieManager)
@sheiksyedm
Copy link
Contributor

/azp run maui-pr-uitests 

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@sheiksyedm
Copy link
Contributor

sheiksyedm commented Jan 29, 2026

/azp run maui-pr-uitests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

kubaflo
kubaflo previously approved these changes Jan 29, 2026
@sheiksyedm
Copy link
Contributor

One mac base image still needs to be added here. All Mac tests are failing due to the Xcode selection issue.
image

@jfversluis
Copy link
Member

/rebase

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

github-actions bot pushed a commit that referenced this pull request Jan 29, 2026
- Issue18751/18896 local images: covered by #33737
- Issue12134 timeout: covered by #33689 (uses native CookieManager)
@sheiksyedm
Copy link
Contributor

/azp run maui-pr-uitests 

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

PureWeen added a commit that referenced this pull request Jan 31, 2026
…33749)

> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Description

This PR improves the reliability of several flaky UI tests by:

1. **Replacing `Thread.Sleep` with `retryTimeout`** - The `retryTimeout`
parameter keeps retrying screenshot comparisons until they match or
timeout, adapting to actual UI timing across different machines/load
conditions.

2. **Fixing Issue10563 SwipeView button animations** - Added flat
`Background = SolidColorBrush(Colors.LightGray)` to buttons to prevent
ripple animation artifacts that caused visual differences on CI.

## Changes

| Test | Issue | Fix |
|------|-------|-----|
| Issue10563 | Button ripple animation artifacts in SwipeView test |
Flat button background + updated baselines |
| Issue18857 | Thread.Sleep causes flakiness | `retryTimeout:
TimeSpan.FromSeconds(2)` |
| Issue24856 | Thread.Sleep causes flakiness | `retryTimeout:
TimeSpan.FromSeconds(2)` |
| Issue25192 | Thread.Sleep causes flakiness | `retryTimeout:
TimeSpan.FromSeconds(2)` |
| Issue27418 | Thread.Sleep causes flakiness | `retryTimeout:
TimeSpan.FromSeconds(2)` |
| Issue28657 | Thread.Sleep causes flakiness | `retryTimeout:
TimeSpan.FromSeconds(2)` |
| Issue30575 | Thread.Sleep causes flakiness | `retryTimeout:
TimeSpan.FromSeconds(3)` |

## Related PRs (not overlapping)

- #33737 - Fixes Issue18751/18896 (local monkey images)
- #33689 - Fixes Issue12134 (WebView cookies)

---------

Co-authored-by: Ahamed-Ali <102580874+Ahamed-Ali@users.noreply.github.com>
kubaflo pushed a commit to kubaflo/maui that referenced this pull request Feb 2, 2026
…otnet#33749)

> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

## Description

This PR improves the reliability of several flaky UI tests by:

1. **Replacing `Thread.Sleep` with `retryTimeout`** - The `retryTimeout`
parameter keeps retrying screenshot comparisons until they match or
timeout, adapting to actual UI timing across different machines/load
conditions.

2. **Fixing Issue10563 SwipeView button animations** - Added flat
`Background = SolidColorBrush(Colors.LightGray)` to buttons to prevent
ripple animation artifacts that caused visual differences on CI.

## Changes

| Test | Issue | Fix |
|------|-------|-----|
| Issue10563 | Button ripple animation artifacts in SwipeView test |
Flat button background + updated baselines |
| Issue18857 | Thread.Sleep causes flakiness | `retryTimeout:
TimeSpan.FromSeconds(2)` |
| Issue24856 | Thread.Sleep causes flakiness | `retryTimeout:
TimeSpan.FromSeconds(2)` |
| Issue25192 | Thread.Sleep causes flakiness | `retryTimeout:
TimeSpan.FromSeconds(2)` |
| Issue27418 | Thread.Sleep causes flakiness | `retryTimeout:
TimeSpan.FromSeconds(2)` |
| Issue28657 | Thread.Sleep causes flakiness | `retryTimeout:
TimeSpan.FromSeconds(2)` |
| Issue30575 | Thread.Sleep causes flakiness | `retryTimeout:
TimeSpan.FromSeconds(3)` |

## Related PRs (not overlapping)

- dotnet#33737 - Fixes Issue18751/18896 (local monkey images)
- dotnet#33689 - Fixes Issue12134 (WebView cookies)

---------

Co-authored-by: Ahamed-Ali <102580874+Ahamed-Ali@users.noreply.github.com>
@PureWeen
Copy link
Member

PureWeen commented Feb 2, 2026

  • the tests these are involved with are all passing

@PureWeen PureWeen merged commit 9b2ae2b into dotnet:main Feb 2, 2026
142 of 149 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration testing-flakiness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Testing] Resolve the flaky UITests on Android, iOS and Mac for Issue18896Test and Issue18751Test

6 participants